import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import axios from 'axios'

export const usejokerStore = defineStore('joker', () => {
const joke = ref('来一个笑话')
const refreshJoke = async () => {
  const res = await axios.get('https://api-vue-base.itheima.net/api/joke')
  joke.value = res.data
}

  return { joke, refreshJoke}
})
